﻿function btnComplete() {
    if (act == -1) {
        act = getParamValue("act");
    }
    var sel = getSelectItem("id_sel_org"); //<option value='{0}'  wfinhertfrom='{1}' wfact='{3}'>{2}</option>
    if (sel == undefined) return;

    nsproc.btnComplete(act, sel.value, sel.getAttribute("wfinhertfrom"), sel.getAttribute("wfact"), sel.getAttribute("wfabs"));
    window.parent.document.getElementById("right").src = "NotificationPanel.aspx";
}

function btnCancel() {
    if (act == -1) act = getParamValue("act");
    var v = nsproc.btnCancel(act);
    window.parent.document.getElementById("right").src = "NotificationPanel.aspx";
}

function btnSuspend() {
    if (act == -1) act = getParamValue("act");
    var v = nsproc.btnSuspend(act);
    window.parent.document.getElementById("right").src = "NotificationPanel.aspx";
}

function $(id) {
    return document.getElementById(id);
}

var act = -1;
function loadCase() {
    act = getParamValue("act");
    var v = nsproc.LoadActAndCases(act).value;
    if (v == null) return;
    $("caseid").value = v.Rows[0]["CASEID"];
    $("casetitle").value = v.Rows[0]["TITLE"];
    $("casecontent").value = v.Rows[0]["CONTENT"];
}

addLoadFuc(function () {
    bindDeps();
    loadCase();
});

///----------绑定组织(单位)-------------------------

function bindDeps() {
    if (act == -1) {
        act = getParamValue("act");
    }
    var dt = nsproc.GetDeps(act).value;
    if (dt == null) return;
    document.querySelector("#id_sel_org").innerHTML = dt;
}